package nl.hu.verbrandendephoenix.view;

import com.google.gwt.user.client.ui.*;

public class BuyCredits {
	
	public Grid grdCredForm;
	public Panel pnlCredForm;
	public ListBox lbxCreds;
	public TextBox txtCreds;
	public Label lblCreds, lblCreds2, lblPrice, lblConfirm;
	public Button btnSubmit1, btnSubmit2, btnSubmit3, btnCancel, btnCancel2;
	
	public BuyCredits(){
		pnlCredForm = new VerticalPanel();
	}
	
	public Panel ConstructPanel(){
		
		
		grdCredForm = new Grid(6, 5);
		
		lblCreds = new Label("Hoeveel credits wilt u kopen?");
		
		lbxCreds = new ListBox();
		filllbxCreds();
		
		
		btnSubmit1 = new Button("Submit");
		
		lblCreds2 = new Label("Of geef zelf een hoeveelheid");
		
		txtCreds = new TextBox();
		
		btnSubmit2 = new Button("Submit");
		btnCancel = new Button("Annuleer");
		
		lblConfirm = new Label("");
		btnSubmit3 = new Button("Submit");
		btnCancel2 = new Button("Annuleer");
		
		
		grdCredForm.setWidget(0,1, lblCreds);
		grdCredForm.setWidget(1,1,lbxCreds);
		grdCredForm.setWidget(2,1, btnSubmit1);
		grdCredForm.setWidget(3,1, lblCreds2);
		grdCredForm.setWidget(4,1, txtCreds);
		grdCredForm.setWidget(5,1, btnSubmit2);
		grdCredForm.setWidget(5,2, btnCancel);
		
		pnlCredForm.add(grdCredForm);
		
		return pnlCredForm;
	}
	
	public Label getlblCreds(){
		return lblCreds;
	}
	
	public ListBox getlbxCreds(){
		return lbxCreds;
	}
	
	public Button getbtnSubmit1(){
		return btnSubmit1;
	}
	
	public TextBox gettxtCreds(){
		return txtCreds;
	}
	
	public Button getbtnSubmit2(){
		return btnSubmit2;
	}
	
	public Button getbtnCancel(){
		return btnCancel;
	}
	
	public Button getbtnCancel2(){
		return btnCancel2;
	}
	
	public Label getlblConfirm(){
		return lblConfirm;
	}
	
	public Label getlblPrice(){
		return lblPrice;
	}
	
	public Button getbtnSubmit3(){
		return btnSubmit3;
	}
	
	public void setlblPrice(int prijs){
		lblPrice.setText(""+ prijs);
	}
	
	public void setlblConfirm(String text){
		lblConfirm.setText(text);
	}
	
	public void filllbxCreds(){
		lbxCreds.addItem(null);
		lbxCreds.addItem("1 credit = \u20AC 1");
		lbxCreds.addItem("10 credits = \u20AC 10");
		lbxCreds.addItem("25 credits = \u20AC 25");
		lbxCreds.addItem("50 credits = \u20AC 50");
		lbxCreds.addItem("100 credits = \u20AC 100");
		lbxCreds.addItem("250 credits = \u20AC 250");
		lbxCreds.addItem("500 credits = \u20AC 500");
		lbxCreds.addItem("1000 credits = \u20AC 1000");
	}
	
	public void setlblCreds(String text){
		lblCreds.setText(text);
	}

}
